module PHaskellTypes where
 
data HaskellType = Bool | Int | Arrow HaskellType HaskellType | UserDef String | Unknown
						deriving (Eq,Show)

type TypeDefinition = (String, HaskellType) 

data Exp = 
           App Exp Exp
         | Integer String 
         | Variable String
         | Boolean String
         | Lambda Exp HaskellType Exp   --nombre de la var, tipo, exprecion 
         | If Exp Exp Exp  
         | IfOnly Exp Exp 
            deriving (Eq,Show)	  				   

data ConstructorType = ConstructorType String [HaskellType]
							deriving (Eq,Show)

data SuperCombinator =   TypeDefinitionSc TypeDefinition 
                         -- Nombre del tipo, lista de constructores
                       | UserTypeDefinition String [ConstructorType] 
                         --Function Name, [variables name, matching expresion], 
                           --Expresion, locals def
                       | FunctionDefinitionSc String [Exp] Exp Program 
                       | GeneratrixTunneling Generatrix
                       		deriving (Eq,Show)

-- return type, funcion name,  argument list, Cargs, Codegenerators
data Generatrix = Generatrix  [String] String [Exp] [CArg] CExp 
					deriving (Eq,Show) 

type GeneratrixProgram = [Generatrix]
type Program           = [SuperCombinator]
